from rest_framework import serializers

from apps.club_system.club.models import ClubType


# 社团分类序列化器
class ClubTypeserializer(serializers.ModelSerializer):
    created_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M", required=False, read_only=True)
    updated_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M", required=False, read_only=True)

    class Meta:
        model = ClubType
        fields = ('id', 'name', 'is_active', 'updated_time', 'created_time')


class ClubTypeListserializer(serializers.ModelSerializer):

    class Meta:
        model = ClubType
        fields = ('id', 'name')
